<?php

namespace Trois\MainServerRegister;

use EasySwoole\EasySwoole\Swoole\EventRegister;
use Trois\Design\Observer\Observer;
use Trois\MainServerRegister\Registers\CrontabRegister;
use Trois\MainServerRegister\Registers\DiRegister;
use Trois\MainServerRegister\Registers\FileWatcherRegister;
use Trois\MainServerRegister\Registers\OrmKeepRegister;
use Trois\MainServerRegister\Registers\ProcessRegister;
use Trois\MainServerRegister\Registers\TplRegister;


class MainServerRegister
{
    public function run(EventRegister $register)
    {

        $observer = new Observer();

        $observer->add(FileWatcherRegister::getInstance($register));
        $observer->add(CrontabRegister::getInstance($register));
        $observer->add(TplRegister::getInstance($register));
        $observer->add(DiRegister::getInstance($register));
        $observer->add(ProcessRegister::getInstance($register));
        $observer->add(OrmKeepRegister::getInstance($register));

        $observer->notify();

    }
}